<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:insert="~{include :: header('账户')}" />
</head>
<body class="hold-transition">
<div class="container-fluid mt-2 mb-2">
    <form id="form-user-account" class="form-horizontal"  th:object="${userAccountDTO}">
        <input id="flag" name="flag" type="hidden" th:value="${flag}">
        <input id="userId" name="userId" type="hidden" th:value="*{userId}">
        <div class="form-group row">
            <label class="col-sm-2 text-sm-right col-form-label">用户名</label>
            <span class="col-sm-3 col-form-label" th:text="*{userName} + '('+*{userId}+')'"></span>
            <label class="col-sm-2 text-sm-right col-form-label">手机号</label>
            <span class="col-sm-3 col-form-label" th:text="*{mobile}"></span>
        </div>
        <div class="form-group row">
            <label class="col-sm-2 text-sm-right col-form-label">账户余额</label>
            <span class="col-sm-3 col-form-label" th:text="${userAccountDTO.balance/100.0}"></span>
            <label class="col-sm-2 text-sm-right col-form-label">冻结余额</label>
            <span class="col-sm-3 col-form-label" th:text="${userAccountDTO.frozenAmount/100.0}"></span>
        </div>
        <div class="form-group row">
            <label class="col-sm-2 text-sm-right col-form-label">返现金额</label>
            <span class="col-sm-3 col-form-label" th:text="${userAccountDTO.backAmount/100.0}"></span>
            <label class="col-sm-2 text-sm-right col-form-label">充值金额</label>
            <span class="col-sm-3 col-form-label" th:text="${userAccountDTO.vmAmount/100.0}"></span>
        </div>
        <div class="form-group row">
            <label class="col-sm-2 text-sm-right col-form-label">账户状态</label>
            <span class="col-sm-3 col-form-label" th:text="${userAccountDTO.accountStatus == 'ACTIVE'?'正常':'冻结'}"></span>
        </div>
        <div class="form-group row">
            <label id="lableText" class="col-sm-2 text-sm-right col-form-label" th:text="${flag == 'credit'?'充值金额：':'扣款金额：'}" style="color: red">充值金额</label>
            <input id="money" name="money" value="0" class="col-sm-3 form-control" type="number">
        </div>
    </form>
</div>
<th:block th:insert="~{include :: footer}" />
</body>
<script>
    $("#form-user-account").validate({
        focusCleanup: true
    });
    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save("/user/account/recharge.json", $('#form-user-account').serialize());
        }
    }
</script>
</html>
